<?php
/**
 * Created by PhpStorm.
 * User: reshared
 * Date: 2017/10/2
 * Time: 上午10:39
 */

namespace Index\Controller;


use Index\Repository\AdRepository;
use Index\Repository\CourseRepository;
use Index\Repository\SettingRepository;
use Index\Repository\UserRepository;

class CourseController extends BaseController
{
    public function index()
    {
        //获取焦点
        $focus = CourseRepository::instance()->getFocus();
        //格式化 焦点
        $focus = CourseRepository::instance()->focusFormat($focus);
        //当前登录用户 未登录则为false
        $user = UserRepository::instance()->user();
        //联系方式
        $contacts = SettingRepository::instance()->get(array('qq', 'wexin', 'weibo', 'phone'));
        //格式化 联系方式
        $contacts = SettingRepository::instance()->settingFormat($contacts);
        //登录下方广告位
        $ad = AdRepository::instance()->getOneByKey('course-behind-login');
    }
}